import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:syn_4s/core/constants/sp_key.dart';

class LoginViewModel {
  var pwdVisible = false.obs;
  var isRemember = false.obs;
  String? username;
  final GlobalKey<FormState> loginFormKey = GlobalKey();
  final TextEditingController userController = TextEditingController();
  final TextEditingController pwdController = TextEditingController();

  LoginViewModel() {
    SharedPreferences.getInstance().then((value) {
      isRemember.value = value.getBool(keyRememberPwd) ?? false;
      userController.text = value.getString(keyUser)??"";
      pwdController.text = value.getString(keyPassword)??"";
    });
  }
}
